import 'package:ai_data_capture/bean/ConfigFileBean.dart';
import 'package:ai_data_capture/bean/CurrentConfgiBean.dart';
import 'package:ai_data_capture/req/network_service.dart';

class CurrentConfigApi {
  static Future<CurrentConfgiBean?> getCurrentConfig() async {
    var res = await NetworkService.post(
        url: "current_config/get_current_config_file", map: {});
    return res?.getTypedData((m) => CurrentConfgiBean.fromJson(m));
  }

  static setupConfigFile(ConfigFileBean bean) async {
    await NetworkService.post(
        url: "current_config/setup_current_config_file",
        map: {
          "id": bean.id,
          "description": bean.description,
        });
  }
}
